home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 76 / DVD Actual 1 Marzo 2003.iso / Trial / TurboCAD 7.1 Pro / Data.Cab / F24525_SDKDemoCtl.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-10  |  2.2 KB  |  87 lines

  1. // SDKDemoCtl.h : Declaration of the CSDKDemoCtrl OLE control class.
  2.  
  3. /////////////////////////////////////////////////////////////////////////////
  4. // CSDKDemoCtrl : See SDKDemoCtl.cpp for implementation.
  5.  
  6. class CSDKDemoCtrl : public COleControl
  7. {
  8.     DECLARE_DYNCREATE(CSDKDemoCtrl)
  9.  
  10. // Constructor
  11. public:
  12.     CSDKDemoCtrl();
  13.  
  14. // Overrides
  15.     // ClassWizard generated virtual function overrides
  16.     //{{AFX_VIRTUAL(CSDKDemoCtrl)
  17.     public:
  18.     virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  19.     virtual void DoPropExchange(CPropExchange* pPX);
  20.     virtual void OnResetState();
  21.     protected:
  22.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  23.     //}}AFX_VIRTUAL
  24.  
  25. // Implementation
  26. protected:
  27.     CString m_strAllLayers;
  28.     BOOL m_bFirstDraw;
  29.     IApplication* m_pIApp;
  30.     IDrawing* m_pIDrawing;
  31.     View* m_pView;
  32.     CPoint m_ptMouseDown;
  33.     double m_dragX;
  34.     double m_dragY;
  35.     VARIANT m_dragOutline;
  36.     IGraphic* m_pDragGraphic;
  37.     BOOL m_bDragging;
  38.  
  39.     ~CSDKDemoCtrl();
  40.     BOOL OpenDrawing(const CString& strFileName);
  41.     void CloseDrawing();
  42.     BOOL BeginDrag(const CPoint& point);
  43.     void Drag(const CPoint& point);
  44.     void EndDrag(const CPoint& point);
  45.  
  46.     DECLARE_OLECREATE_EX(CSDKDemoCtrl)    // Class factory and guid
  47.     DECLARE_OLETYPELIB(CSDKDemoCtrl)      // GetTypeInfo
  48.     DECLARE_PROPPAGEIDS(CSDKDemoCtrl)     // Property page IDs
  49.     DECLARE_OLECTLTYPE(CSDKDemoCtrl)        // Type name and misc status
  50.  
  51. // Message maps
  52.     //{{AFX_MSG(CSDKDemoCtrl)
  53.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  54.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  55.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  56.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  57.     //}}AFX_MSG
  58.     DECLARE_MESSAGE_MAP()
  59.  
  60. // Dispatch maps
  61.     //{{AFX_DISPATCH(CSDKDemoCtrl)
  62.     CString m_strFileName;
  63.     afx_msg void OnFileNameChanged();
  64.     CString m_strHideLayers;
  65.     afx_msg void OnHideLayersChanged();
  66.     afx_msg BSTR GetAllLayers();
  67.     //}}AFX_DISPATCH
  68.     DECLARE_DISPATCH_MAP()
  69.  
  70.     afx_msg void AboutBox();
  71.  
  72. // Event maps
  73.     //{{AFX_EVENT(CSDKDemoCtrl)
  74.     //}}AFX_EVENT
  75.     DECLARE_EVENT_MAP()
  76.  
  77. // Dispatch and event IDs
  78. public:
  79.     enum {
  80.     //{{AFX_DISP_ID(CSDKDemoCtrl)
  81.     dispidFileName = 1L,
  82.     dispidHideLayers = 2L,
  83.     dispidAllLayers = 3L,
  84.     //}}AFX_DISP_ID
  85.     };
  86. };
  87.